package com.crrc.dataparse.monitor.rsp.service.parse.treat.templatepara.datatrans;

import com.crrc.dataparse.base.exception.RSPException;
import com.crrc.dataparse.templatepara.IDataTrans;
import com.crrc.dataparse.templatepara.datatrans.utils.DataTranslator;

/*
     2进制转16进制
 */
public class BinaryToHex extends IDataTrans {
    public BinaryToHex() {
    }
    @Override
    public String trans(String value, double resolution, double offset) throws RSPException {
        return !DataTranslator.isValid(value) ? null : Long.toString(Long.parseLong(value, 2), 16).toUpperCase();
    }
}
